package com.hc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hc.domain.User;
import com.hc.query.UserCondition;
import com.hc.res.UserItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 六月Bing
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    int updateBatchSelective(List<User> list);

    int batchInsert(@Param("list") List<User> list);

    /**
     * 用户列表分页查询
     */
    IPage<UserItem> selectList(IPage<UserItem> page, @Param("condition") UserCondition condition);

    /**
     * 通过用户名查询用户
     * @param nickname
     * @return
     */
    User selectByNickname(String nickname);

    /**
     * 查询个人信息
     * @param id
     * @return
     */
    User selectPersonal(Long id);

}